import {
    defineConfig,
    extractorSvelte,
    presetIcons,
    presetUno,
    presetAttributify,
    presetTypography,
    presetWebFonts,
    transformerDirectives,
    transformerCompileClass,
    transformerVariantGroup
} from 'unocss';
// import { defineConfig } from 'unocss/vite';

// import { extractorSvelte } from '@unocss/core'
// import presetIcons from '@unocss/preset-icons'
// import presetWebFonts from '@unocss/preset-web-fonts'
// import presetUno from '@unocss/preset-uno'
// import presetAttributify from '@unocss/preset-attributify'
// import presetTypography from "@unocss/preset-typography"
// import transformerDirective from '@unocss/transformer-directives';
// import transformerVariantGroup from '@unocss/transformer-variant-group';
// import transformerCompileClass from '@unocss/transformer-compile-class';
export default defineConfig({
    // mode: 'svelte-scoped',
    extractors: [extractorSvelte],
    shortcuts: {
        "colors-primary": "c-purple-600 font-mono",
        "colors-secondary": "c-gray-400 font-sans",
        "icon-btn": "inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600",
    },
    presets: [
        // 默认设置
        presetUno(),
        // 简化指令 自定义
        presetAttributify({
            // prefix: 'un-',
            // prefixedOnly: true, // <--
        }),
        presetTypography({}), //排版
        presetIcons({
            scale: 1.2,
            warn: true
        }),
        presetWebFonts({
            provider: 'google', // default provider
            fonts: {
                // these will extend the default theme
                sans: 'Roboto',
                mono: ['Fira Code', 'Fira Mono:400,700'],
                // custom ones
                lobster: 'Lobster',
                lato: [
                    {
                        name: 'Lato',
                        weights: ['400', '700'],
                        italic: true,
                    },
                    {
                        name: 'sans-serif',
                        provider: 'none',
                    },
                ],
            },
        })
    ],
    transformers: [transformerDirectives(), transformerVariantGroup(), transformerCompileClass()],
    safelist: "prose prose-sm m-auto text-left".split(" "),
});
